package com.ruoyi.system.domain;

import java.sql.Time;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 挂号预约对象 convention
 * 
 * @author ruoyi
 * @date 2024-02-26
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Convention extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 预约id */
    private Long id;

    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;

    /** 科室id */
    @Excel(name = "科室id")
    private Long departmentId;

    /** 医生id */
    @Excel(name = "医生id")
    private Long docId;

    /** 患者编号 */
    @Excel(name = "患者编号")
    private Long patId;

    /** 挂号类型id */
    @Excel(name = "挂号类型id")
    private Long typeId;

    /** 费用 */
    @Excel(name = "费用")
    private String money;

    /** 预约日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预约日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date date;

    /** 时间段id */
    @Excel(name = "时间段id")
    private Long timeId;

    /** 预约状态，0等待，1完成，2取消 */
    @Excel(name = "预约状态，0等待，1完成，2取消")
    private Long state;

    /** 删除状态，0未，1删除 */
    @Excel(name = "删除状态，0未，1删除")
    private Long del;

    //子用户实体
    private User user;

    //子患者实体
    private Patient patient;

    //科室名
    private String deName;

    //医生名
    private String doName;

    //挂号类型名
    private String reName;

    //价格
    private Double prMoney;

    //开始时间
    private LocalTime startTime;

    //结束时间
    private LocalTime endTime;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("departmentId", getDepartmentId())
            .append("docId", getDocId())
            .append("patId", getPatId())
            .append("typeId", getTypeId())
            .append("money", getMoney())
            .append("date", getDate())
            .append("timeId", getTimeId())
            .append("state", getState())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("del", getDel())
            .toString();
    }
}
